From: kaf24@firebug.cl.cam.ac.uk Date: Wed, 14 Sep 2005 09:17:44 +0000 (+0000) Subject: Move hypervisor.h to asm-i386/asm-x86_64. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16806^2~21 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e1517da4cd97c490a857d1717ca0a85129730f73;p=xen.git Move hypervisor.h to asm-i386/asm-x86_64. Signed-off-by: Keir Fraser --- diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c index 31ded2cf58..861c2d2f62 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c @@ -15,7 +15,7 @@ #include #include #endif -#include +#include #include "cpu.h" diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c index 1855042fa0..7915b4f394 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c @@ -53,7 +53,7 @@ #include #include #include -#include +#include #include #include #include "setup_arch_pre.h" diff --git a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c index 7332d2f9af..1b20354c97 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c b/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c index 4ef646b3fe..b5f7005012 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include extern unsigned long *contiguous_bitmap; diff --git a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c index e46d69df0d..503d48842a 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c @@ -25,7 +25,7 @@ #include #include -#include +#include void show_mem(void) { diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c index 5926bcf99e..42508d78fd 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include /* diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c index 12c7610e90..7a8842630b 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c b/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c index a7fe1519f6..1a1d113186 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include /* Referenced in netback.c. */ /*static*/ kmem_cache_t *skbuff_cachep; diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c index 9b3d47b29c..cb0ffc9e51 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c @@ -61,7 +61,7 @@ #include #include #include "setup_arch_pre.h" -#include +#include #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) #define PFN_PHYS(x) ((x) << PAGE_SHIFT) #define end_pfn_map end_pfn diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c index 6d2e43d67e..fc8eff4402 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c @@ -31,7 +31,7 @@ #include #include #ifdef CONFIG_XEN -#include +#include #endif char x86_boot_params[BOOT_PARAM_SIZE] __initdata = {0,}; diff --git a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c index 8887c69e73..521252c8ce 100644 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h index 784fd9a020..fe09f20080 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h b/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h index 8a2acd6046..f2eb0036e5 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h index fb6be0e0e4..7bc92ab2b0 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/linux-2.6-xen-sparse/drivers/xen/blktap/common.h b/linux-2.6-xen-sparse/drivers/xen/blktap/common.h index 3239a17d6b..bed5ee1a3f 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/common.h +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/common.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/linux-2.6-xen-sparse/drivers/xen/console/console.c b/linux-2.6-xen-sparse/drivers/xen/console/console.c index 18ed52c038..1091c6f903 100644 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include #include "xencons_ring.h" diff --git a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c index eb205ee377..154b0c7354 100644 --- a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c +++ b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff --git a/linux-2.6-xen-sparse/drivers/xen/usbback/common.h b/linux-2.6-xen-sparse/drivers/xen/usbback/common.h index 56b3bc31df..b7799ed895 100644 --- a/linux-2.6-xen-sparse/drivers/xen/usbback/common.h +++ b/linux-2.6-xen-sparse/drivers/xen/usbback/common.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c index 3626d1086e..1543959df7 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c @@ -27,7 +27,7 @@ * IN THE SOFTWARE. */ -#include +#include #include #include #include diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c index 47e4fba82f..f18900360b 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c @@ -27,7 +27,7 @@ */ #define DEBUG -#include +#include #include #include #include diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h new file mode 100644 index 0000000000..3c7a42723a --- /dev/null +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h @@ -0,0 +1,189 @@ +/****************************************************************************** + * hypervisor.h + * + * Linux-specific hypervisor handling. + * + * Copyright (c) 2002-2004, K A Fraser + * + * This file may be distributed separately from the Linux kernel, or + * incorporated into other software packages, subject to the following license: + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this source file (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, modify, + * merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef __HYPERVISOR_H__ +#define __HYPERVISOR_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(__i386__) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) +# ifdef CONFIG_X86_PAE +# include +# else +# include +# endif +# else +# define pud_t pgd_t +# endif +#endif + +/* arch/xen/i386/kernel/setup.c */ +extern start_info_t *xen_start_info; + +/* arch/xen/kernel/evtchn.c */ +/* Force a proper event-channel callback from Xen. */ +void force_evtchn_callback(void); + +/* arch/xen/kernel/process.c */ +void xen_cpu_idle (void); + +/* arch/xen/i386/kernel/hypervisor.c */ +void do_hypervisor_callback(struct pt_regs *regs); + +/* arch/xen/i386/kernel/head.S */ +void lgdt_finish(void); + +/* arch/xen/i386/mm/hypervisor.c */ +/* + * NB. ptr values should be PHYSICAL, not MACHINE. 'vals' should be already + * be MACHINE addresses. + */ + +void xen_pt_switch(unsigned long ptr); +void xen_new_user_pt(unsigned long ptr); /* x86_64 only */ +void xen_load_gs(unsigned int selector); /* x86_64 only */ +void xen_tlb_flush(void); +void xen_invlpg(unsigned long ptr); + +#ifndef CONFIG_XEN_SHADOW_MODE +void xen_l1_entry_update(pte_t *ptr, pte_t val); +void xen_l2_entry_update(pmd_t *ptr, pmd_t val); +void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64/PAE */ +void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */ +void xen_pgd_pin(unsigned long ptr); +void xen_pgd_unpin(unsigned long ptr); +void xen_pud_pin(unsigned long ptr); /* x86_64 only */ +void xen_pud_unpin(unsigned long ptr); /* x86_64 only */ +void xen_pmd_pin(unsigned long ptr); /* x86_64 only */ +void xen_pmd_unpin(unsigned long ptr); /* x86_64 only */ +void xen_pte_pin(unsigned long ptr); +void xen_pte_unpin(unsigned long ptr); +#else +#define xen_l1_entry_update(_p, _v) set_pte((_p), (_v)) +#define xen_l2_entry_update(_p, _v) set_pgd((_p), (_v)) +#define xen_pgd_pin(_p) ((void)0) +#define xen_pgd_unpin(_p) ((void)0) +#define xen_pte_pin(_p) ((void)0) +#define xen_pte_unpin(_p) ((void)0) +#endif + +void xen_set_ldt(unsigned long ptr, unsigned long bytes); +void xen_machphys_update(unsigned long mfn, unsigned long pfn); + +#ifdef CONFIG_SMP +#include +void xen_tlb_flush_all(void); +void xen_invlpg_all(unsigned long ptr); +void xen_tlb_flush_mask(cpumask_t *mask); +void xen_invlpg_mask(cpumask_t *mask, unsigned long ptr); +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) +/* +** XXX SMH: 2.4 doesn't have percpu.h (or support SMP guests) so just +** include sufficient #defines to allow the below to build. +*/ +#define DEFINE_PER_CPU(type, name) \ + __typeof__(type) per_cpu__##name + +#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) +#define __get_cpu_var(var) per_cpu__##var +#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name + +#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) +#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) +#endif /* linux < 2.6.0 */ + +void xen_create_contiguous_region(unsigned long vstart, unsigned int order); +void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order); + +#include + +#if defined(CONFIG_X86_64) +#define MULTI_UVMFLAGS_INDEX 2 +#define MULTI_UVMDOMID_INDEX 3 +#else +#define MULTI_UVMFLAGS_INDEX 3 +#define MULTI_UVMDOMID_INDEX 4 +#endif + +static inline void +MULTI_update_va_mapping( + multicall_entry_t *mcl, unsigned long va, + pte_t new_val, unsigned long flags) +{ + mcl->op = __HYPERVISOR_update_va_mapping; + mcl->args[0] = va; +#if defined(CONFIG_X86_64) + mcl->args[1] = new_val.pte; + mcl->args[2] = flags; +#elif defined(CONFIG_X86_PAE) + mcl->args[1] = new_val.pte_low; + mcl->args[2] = new_val.pte_high; + mcl->args[3] = flags; +#else + mcl->args[1] = new_val.pte_low; + mcl->args[2] = 0; + mcl->args[3] = flags; +#endif +} + +static inline void +MULTI_update_va_mapping_otherdomain( + multicall_entry_t *mcl, unsigned long va, + pte_t new_val, unsigned long flags, domid_t domid) +{ + mcl->op = __HYPERVISOR_update_va_mapping_otherdomain; + mcl->args[0] = va; +#if defined(CONFIG_X86_64) + mcl->args[1] = new_val.pte; + mcl->args[2] = flags; + mcl->args[3] = domid; +#elif defined(CONFIG_X86_PAE) + mcl->args[1] = new_val.pte_low; + mcl->args[2] = new_val.pte_high; + mcl->args[3] = flags; + mcl->args[4] = domid; +#else + mcl->args[1] = new_val.pte_low; + mcl->args[2] = 0; + mcl->args[3] = flags; + mcl->args[4] = domid; +#endif +} + +#endif /* __HYPERVISOR_H__ */ diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h index 4779997177..1db7c0382e 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h @@ -2,7 +2,7 @@ #define _I386_PGTABLE_H #include -#include +#include /* * The Linux memory management assumes a three-level page table setup. On diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h index 6c991e8058..a627fbf4fc 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #ifdef __KERNEL__ diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypervisor.h b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypervisor.h new file mode 100644 index 0000000000..dc3e5e5d3b --- /dev/null +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypervisor.h @@ -0,0 +1,2 @@ + +#include diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h index 86f1b4f7fa..d24c5c5299 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h @@ -12,7 +12,7 @@ #include #include #ifdef CONFIG_XEN -#include +#include extern pud_t level3_user_pgt[512]; extern pud_t init_level4_user_pgt[]; diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h index 518dcdf5a3..d06d1485eb 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #ifdef __KERNEL__ diff --git a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h index ff522a927e..db40acaed9 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h +++ b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include #include diff --git a/linux-2.6-xen-sparse/include/asm-xen/gnttab.h b/linux-2.6-xen-sparse/include/asm-xen/gnttab.h index ab4871e663..930eb034ea 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/gnttab.h +++ b/linux-2.6-xen-sparse/include/asm-xen/gnttab.h @@ -14,7 +14,7 @@ #define __ASM_GNTTAB_H__ #include -#include +#include #include /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */ diff --git a/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h b/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h deleted file mode 100644 index 3c7a42723a..0000000000 --- a/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h +++ /dev/null @@ -1,189 +0,0 @@ -/****************************************************************************** - * hypervisor.h - * - * Linux-specific hypervisor handling. - * - * Copyright (c) 2002-2004, K A Fraser - * - * This file may be distributed separately from the Linux kernel, or - * incorporated into other software packages, subject to the following license: - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this source file (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, modify, - * merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -#ifndef __HYPERVISOR_H__ -#define __HYPERVISOR_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(__i386__) -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -# ifdef CONFIG_X86_PAE -# include -# else -# include -# endif -# else -# define pud_t pgd_t -# endif -#endif - -/* arch/xen/i386/kernel/setup.c */ -extern start_info_t *xen_start_info; - -/* arch/xen/kernel/evtchn.c */ -/* Force a proper event-channel callback from Xen. */ -void force_evtchn_callback(void); - -/* arch/xen/kernel/process.c */ -void xen_cpu_idle (void); - -/* arch/xen/i386/kernel/hypervisor.c */ -void do_hypervisor_callback(struct pt_regs *regs); - -/* arch/xen/i386/kernel/head.S */ -void lgdt_finish(void); - -/* arch/xen/i386/mm/hypervisor.c */ -/* - * NB. ptr values should be PHYSICAL, not MACHINE. 'vals' should be already - * be MACHINE addresses. - */ - -void xen_pt_switch(unsigned long ptr); -void xen_new_user_pt(unsigned long ptr); /* x86_64 only */ -void xen_load_gs(unsigned int selector); /* x86_64 only */ -void xen_tlb_flush(void); -void xen_invlpg(unsigned long ptr); - -#ifndef CONFIG_XEN_SHADOW_MODE -void xen_l1_entry_update(pte_t *ptr, pte_t val); -void xen_l2_entry_update(pmd_t *ptr, pmd_t val); -void xen_l3_entry_update(pud_t *ptr, pud_t val); /* x86_64/PAE */ -void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */ -void xen_pgd_pin(unsigned long ptr); -void xen_pgd_unpin(unsigned long ptr); -void xen_pud_pin(unsigned long ptr); /* x86_64 only */ -void xen_pud_unpin(unsigned long ptr); /* x86_64 only */ -void xen_pmd_pin(unsigned long ptr); /* x86_64 only */ -void xen_pmd_unpin(unsigned long ptr); /* x86_64 only */ -void xen_pte_pin(unsigned long ptr); -void xen_pte_unpin(unsigned long ptr); -#else -#define xen_l1_entry_update(_p, _v) set_pte((_p), (_v)) -#define xen_l2_entry_update(_p, _v) set_pgd((_p), (_v)) -#define xen_pgd_pin(_p) ((void)0) -#define xen_pgd_unpin(_p) ((void)0) -#define xen_pte_pin(_p) ((void)0) -#define xen_pte_unpin(_p) ((void)0) -#endif - -void xen_set_ldt(unsigned long ptr, unsigned long bytes); -void xen_machphys_update(unsigned long mfn, unsigned long pfn); - -#ifdef CONFIG_SMP -#include -void xen_tlb_flush_all(void); -void xen_invlpg_all(unsigned long ptr); -void xen_tlb_flush_mask(cpumask_t *mask); -void xen_invlpg_mask(cpumask_t *mask, unsigned long ptr); -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) -/* -** XXX SMH: 2.4 doesn't have percpu.h (or support SMP guests) so just -** include sufficient #defines to allow the below to build. -*/ -#define DEFINE_PER_CPU(type, name) \ - __typeof__(type) per_cpu__##name - -#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) -#define __get_cpu_var(var) per_cpu__##var -#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name - -#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) -#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) -#endif /* linux < 2.6.0 */ - -void xen_create_contiguous_region(unsigned long vstart, unsigned int order); -void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order); - -#include - -#if defined(CONFIG_X86_64) -#define MULTI_UVMFLAGS_INDEX 2 -#define MULTI_UVMDOMID_INDEX 3 -#else -#define MULTI_UVMFLAGS_INDEX 3 -#define MULTI_UVMDOMID_INDEX 4 -#endif - -static inline void -MULTI_update_va_mapping( - multicall_entry_t *mcl, unsigned long va, - pte_t new_val, unsigned long flags) -{ - mcl->op = __HYPERVISOR_update_va_mapping; - mcl->args[0] = va; -#if defined(CONFIG_X86_64) - mcl->args[1] = new_val.pte; - mcl->args[2] = flags; -#elif defined(CONFIG_X86_PAE) - mcl->args[1] = new_val.pte_low; - mcl->args[2] = new_val.pte_high; - mcl->args[3] = flags; -#else - mcl->args[1] = new_val.pte_low; - mcl->args[2] = 0; - mcl->args[3] = flags; -#endif -} - -static inline void -MULTI_update_va_mapping_otherdomain( - multicall_entry_t *mcl, unsigned long va, - pte_t new_val, unsigned long flags, domid_t domid) -{ - mcl->op = __HYPERVISOR_update_va_mapping_otherdomain; - mcl->args[0] = va; -#if defined(CONFIG_X86_64) - mcl->args[1] = new_val.pte; - mcl->args[2] = flags; - mcl->args[3] = domid; -#elif defined(CONFIG_X86_PAE) - mcl->args[1] = new_val.pte_low; - mcl->args[2] = new_val.pte_high; - mcl->args[3] = flags; - mcl->args[4] = domid; -#else - mcl->args[1] = new_val.pte_low; - mcl->args[2] = 0; - mcl->args[3] = flags; - mcl->args[4] = domid; -#endif -} - -#endif /* __HYPERVISOR_H__ */